﻿using Download.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Download
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        private ObservableCollection<AvailableModel> AvailableList_;

        public ObservableCollection<AvailableModel> AvailableList
        {
            get { return AvailableList_; }
            set { AvailableList_ = value; }
        }

        public MainWindow()
        {
            InitializeComponent();
            AvailableList=new ObservableCollection<AvailableModel>();
            AvailableList.Add(new AvailableModel()
            {
                IconUir= "D:\\Desktop\\HALCON\\logo.jpg",
                Describeinfo="小工具\r\n版本17.0.0.0正式版\r\n仅提供内部使用"
            });
            this.DataContext = this;
        }
        /// <summary>
        /// 窗体最小化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState=WindowState.Minimized;
        }
        /// <summary>
        /// 窗体最大化 最小化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if(this.WindowState != WindowState.Maximized)
            {
                this.WindowState = WindowState.Maximized;
                //代码在这
                //this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
                //this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
            }
            else
            {
                this.WindowState = WindowState.Normal;
            }
        }
        /// <summary>
        /// 窗体关闭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            this.Close();   
        }


        private void DockPanel_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
                this.DragMove();
        }

        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            Downloaddtl downloaddtl=new Downloaddtl();
            downloaddtl.ShowDialog();
        }
    }
}
